<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__wdt.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">WDT (Watchdog Timer)<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >High level interface to the Watchdog Timer (WDT). </p>
<p >The WDT can be used for recovering from a CPU or firmware failure. The WDT is initialized with a timeout interval. Once the WDT is started, <a class="el" href="group__group__hal__wdt.html#gaeb43bee6a246da3eedfb5d06fbd226de">cyhal_wdt_kick</a> must be called at least once within each timeout interval to reset the count. In case the firmware fails to do so, it is considered to be a CPU crash or firmware failure and the device will be reset.</p>
<h1><a class="anchor" id="subsection_wdt_features"></a>
Features</h1>
<p >WDT resets the device if the WDT is not "kicked" using <a class="el" href="group__group__hal__wdt.html#gaeb43bee6a246da3eedfb5d06fbd226de">cyhal_wdt_kick</a> within the configured timeout interval.</p>
<h1><a class="anchor" id="subsection_wdt_quickstart"></a>
Quick Start</h1>
<p ><a class="el" href="group__group__hal__wdt.html#ga4f2a8a684b8a76b92b9417637bb55697">cyhal_wdt_init()</a> is used to initialize the WDT by providing the WDT object (<b>obj</b>) and the timeout (<b>timeout_ms</b>) value in milliseconds. The timeout parameter can have a minimum value of 1ms. The maximum value of the timeout parameter can be obtained using the <a class="el" href="group__group__hal__wdt.html#gaf121c3f36d38b275c1887b8fddf96a3f" title="Gets the maximum WDT timeout in milliseconds.">cyhal_wdt_get_max_timeout_ms()</a>.</p>
<h1><a class="anchor" id="subsection_wdt_snippet"></a>
Code Snippet</h1>
<h2><a class="anchor" id="subsection_wdt_snippet1"></a>
Snippet 1: Initialize the WDT and kick periodically</h2>
<p >The following snippet initializes the WDT and illustrates how to reset the WDT within the timeout interval. </p><div class="fragment"><div class="line"><span class="preprocessor">    #define LED_ON      0u</span></div>
<div class="line"><span class="preprocessor">    #define LED_OFF     1u</span></div>
<div class="line"> </div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> wdt_obj;</div>
<div class="line">    uint32_t    timeout_ms = 2000; <span class="comment">// Minimum value of timeout_ms is 1ms</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initializing WDT</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__wdt.html#ga4f2a8a684b8a76b92b9417637bb55697">cyhal_wdt_init</a>(&amp;wdt_obj, timeout_ms);</div>
<div class="line">    CY_ASSERT(<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize the pin connected to an LED on the board</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">cyhal_gpio_init</a>(CYBSP_USER_LED, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec">CYHAL_GPIO_DIR_OUTPUT</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b">CYHAL_GPIO_DRIVE_STRONG</a>,</div>
<div class="line">                    CYBSP_LED_STATE_OFF);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Device power-on reset or XRES event - blink LED once</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__gpio.html#gaf66e7c3ed7b3b0711635d7687ae92291">cyhal_gpio_write</a>(CYBSP_USER_LED, CYBSP_LED_STATE_ON);</div>
<div class="line">    <a class="code hl_function" href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">cyhal_system_delay_ms</a>(100);</div>
<div class="line">    <a class="code hl_function" href="group__group__hal__gpio.html#gaf66e7c3ed7b3b0711635d7687ae92291">cyhal_gpio_write</a>(CYBSP_USER_LED, CYBSP_LED_STATE_OFF);</div>
<div class="line">    <a class="code hl_function" href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">cyhal_system_delay_ms</a>(100);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Device has restarted due to Watchdog timeout - blink a second time</span></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a28d2eb1bf90f731f930c487d8dcd8079">CYHAL_SYSTEM_RESET_WDT</a> == <a class="code hl_function" href="group__group__hal__system.html#ga9a7b601e0b06a896860f411103a4abc6">cyhal_system_get_reset_reason</a>())</div>
<div class="line">    {</div>
<div class="line">        <a class="code hl_function" href="group__group__hal__gpio.html#gaf66e7c3ed7b3b0711635d7687ae92291">cyhal_gpio_write</a>(CYBSP_USER_LED, CYBSP_LED_STATE_ON);</div>
<div class="line">        <a class="code hl_function" href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">cyhal_system_delay_ms</a>(100);</div>
<div class="line">        <a class="code hl_function" href="group__group__hal__gpio.html#gaf66e7c3ed7b3b0711635d7687ae92291">cyhal_gpio_write</a>(CYBSP_USER_LED, CYBSP_LED_STATE_OFF);</div>
<div class="line">        <a class="code hl_function" href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">cyhal_system_delay_ms</a>(100);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize WDT</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__wdt.html#ga4f2a8a684b8a76b92b9417637bb55697">cyhal_wdt_init</a>(&amp;wdt_obj, timeout_ms);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">while</span> (loop)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// This delay emulates an application task executed between subsequent WDT kicks. Increasing</span></div>
<div class="line">        <span class="comment">// this delay to beyond the programmed WDT timeout will cause a device reset.</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">cyhal_system_delay_ms</a>(1000);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Reset the WDT and avoid a device reset</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__wdt.html#gaeb43bee6a246da3eedfb5d06fbd226de">cyhal_wdt_kick</a>(&amp;wdt_obj);</div>
<div class="line">    }</div>
<div class="ttc" id="agroup__group__hal__gpio_html_gab93322030909d3af6a9fc1a3b2eccbaa"><div class="ttname"><a href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">cyhal_gpio_init</a></div><div class="ttdeci">cy_rslt_t cyhal_gpio_init(cyhal_gpio_t pin, cyhal_gpio_direction_t direction, cyhal_gpio_drive_mode_t drive_mode, bool init_val)</div><div class="ttdoc">Initialize the GPIO pin   See Snippet 1: Reading value from GPIO.</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gaf66e7c3ed7b3b0711635d7687ae92291"><div class="ttname"><a href="group__group__hal__gpio.html#gaf66e7c3ed7b3b0711635d7687ae92291">cyhal_gpio_write</a></div><div class="ttdeci">void cyhal_gpio_write(cyhal_gpio_t pin, bool value)</div><div class="ttdoc">Set the output value for the pin.</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b"><div class="ttname"><a href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b">CYHAL_GPIO_DRIVE_STRONG</a></div><div class="ttdeci">@ CYHAL_GPIO_DRIVE_STRONG</div><div class="ttdoc">Strong output.</div><div class="ttdef"><b>Definition:</b> cyhal_gpio.h:158</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec"><div class="ttname"><a href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec">CYHAL_GPIO_DIR_OUTPUT</a></div><div class="ttdeci">@ CYHAL_GPIO_DIR_OUTPUT</div><div class="ttdoc">Output pin.</div><div class="ttdef"><b>Definition:</b> cyhal_gpio.h:139</div></div>
<div class="ttc" id="agroup__group__hal__impl__hw__types_html_structcyhal__wdt__t"><div class="ttname"><a href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a></div><div class="ttdoc">WDT object.</div><div class="ttdef"><b>Definition:</b> cyhal_hw_types.h:1599</div></div>
<div class="ttc" id="agroup__group__hal__system_html_ga5f450769c1207d98134a9ced39adfdda"><div class="ttname"><a href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">cyhal_system_delay_ms</a></div><div class="ttdeci">cy_rslt_t cyhal_system_delay_ms(uint32_t milliseconds)</div><div class="ttdoc">Requests that the current operation delays for at least the specified length of time.</div></div>
<div class="ttc" id="agroup__group__hal__system_html_ga9a7b601e0b06a896860f411103a4abc6"><div class="ttname"><a href="group__group__hal__system.html#ga9a7b601e0b06a896860f411103a4abc6">cyhal_system_get_reset_reason</a></div><div class="ttdeci">cyhal_reset_reason_t cyhal_system_get_reset_reason(void)</div><div class="ttdoc">Gets the cause of the latest reset or resets that occurred in the system.</div></div>
<div class="ttc" id="agroup__group__hal__system_html_gga53ba6a7416574a1b03890d23b7a90264a28d2eb1bf90f731f930c487d8dcd8079"><div class="ttname"><a href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a28d2eb1bf90f731f930c487d8dcd8079">CYHAL_SYSTEM_RESET_WDT</a></div><div class="ttdeci">@ CYHAL_SYSTEM_RESET_WDT</div><div class="ttdoc">A watchdog timer (WDT) reset has occurred.</div><div class="ttdef"><b>Definition:</b> cyhal_system.h:104</div></div>
<div class="ttc" id="agroup__group__hal__wdt_html_ga4f2a8a684b8a76b92b9417637bb55697"><div class="ttname"><a href="group__group__hal__wdt.html#ga4f2a8a684b8a76b92b9417637bb55697">cyhal_wdt_init</a></div><div class="ttdeci">cy_rslt_t cyhal_wdt_init(cyhal_wdt_t *obj, uint32_t timeout_ms)</div><div class="ttdoc">Initialize and start the WDT.</div></div>
<div class="ttc" id="agroup__group__hal__wdt_html_gaeb43bee6a246da3eedfb5d06fbd226de"><div class="ttname"><a href="group__group__hal__wdt.html#gaeb43bee6a246da3eedfb5d06fbd226de">cyhal_wdt_kick</a></div><div class="ttdeci">void cyhal_wdt_kick(cyhal_wdt_t *obj)</div><div class="ttdoc">Resets the WDT.</div></div>
<div class="ttc" id="agroup__group__result_html_gaf58fac450d9fff4472f03ad68f6e546e"><div class="ttname"><a href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a></div><div class="ttdeci">#define CY_RSLT_SUCCESS</div><div class="ttdoc">cy_rslt_t return value indicating success</div><div class="ttdef"><b>Definition:</b> cy_result.h:465</div></div>
</div><!-- fragment --> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__wdt"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__wdt.html">WDT HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__wdt"><td class="mdescLeft">&#160;</td><td class="mdescRight">WDT specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga4f2a8a684b8a76b92b9417637bb55697"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__wdt.html#ga4f2a8a684b8a76b92b9417637bb55697">cyhal_wdt_init</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *obj, uint32_t timeout_ms)</td></tr>
<tr class="memdesc:ga4f2a8a684b8a76b92b9417637bb55697"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize and start the WDT.  <a href="group__group__hal__wdt.html#ga4f2a8a684b8a76b92b9417637bb55697">More...</a><br /></td></tr>
<tr class="separator:ga4f2a8a684b8a76b92b9417637bb55697"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga976a8b0fe8fe66f89311cfca18768b13"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__wdt.html#ga976a8b0fe8fe66f89311cfca18768b13">cyhal_wdt_free</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *obj)</td></tr>
<tr class="memdesc:ga976a8b0fe8fe66f89311cfca18768b13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free the WDT.  <a href="group__group__hal__wdt.html#ga976a8b0fe8fe66f89311cfca18768b13">More...</a><br /></td></tr>
<tr class="separator:ga976a8b0fe8fe66f89311cfca18768b13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeb43bee6a246da3eedfb5d06fbd226de"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__wdt.html#gaeb43bee6a246da3eedfb5d06fbd226de">cyhal_wdt_kick</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *obj)</td></tr>
<tr class="memdesc:gaeb43bee6a246da3eedfb5d06fbd226de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the WDT.  <a href="group__group__hal__wdt.html#gaeb43bee6a246da3eedfb5d06fbd226de">More...</a><br /></td></tr>
<tr class="separator:gaeb43bee6a246da3eedfb5d06fbd226de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaae8da9770e8e061c341bf9f604b91260"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__wdt.html#gaae8da9770e8e061c341bf9f604b91260">cyhal_wdt_start</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *obj)</td></tr>
<tr class="memdesc:gaae8da9770e8e061c341bf9f604b91260"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start (enable) the WDT.  <a href="group__group__hal__wdt.html#gaae8da9770e8e061c341bf9f604b91260">More...</a><br /></td></tr>
<tr class="separator:gaae8da9770e8e061c341bf9f604b91260"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac4a8ed58907508cc2ebf9a29c2d86f39"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__wdt.html#gac4a8ed58907508cc2ebf9a29c2d86f39">cyhal_wdt_stop</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *obj)</td></tr>
<tr class="memdesc:gac4a8ed58907508cc2ebf9a29c2d86f39"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop (disable) the WDT.  <a href="group__group__hal__wdt.html#gac4a8ed58907508cc2ebf9a29c2d86f39">More...</a><br /></td></tr>
<tr class="separator:gac4a8ed58907508cc2ebf9a29c2d86f39"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga84de4fa0ac7dbacb681e82a5df94f6d5"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__wdt.html#ga84de4fa0ac7dbacb681e82a5df94f6d5">cyhal_wdt_get_timeout_ms</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *obj)</td></tr>
<tr class="memdesc:ga84de4fa0ac7dbacb681e82a5df94f6d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the WDT timeout.  <a href="group__group__hal__wdt.html#ga84de4fa0ac7dbacb681e82a5df94f6d5">More...</a><br /></td></tr>
<tr class="separator:ga84de4fa0ac7dbacb681e82a5df94f6d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf121c3f36d38b275c1887b8fddf96a3f"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__wdt.html#gaf121c3f36d38b275c1887b8fddf96a3f">cyhal_wdt_get_max_timeout_ms</a> (void)</td></tr>
<tr class="memdesc:gaf121c3f36d38b275c1887b8fddf96a3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the maximum WDT timeout in milliseconds.  <a href="group__group__hal__wdt.html#gaf121c3f36d38b275c1887b8fddf96a3f">More...</a><br /></td></tr>
<tr class="separator:gaf121c3f36d38b275c1887b8fddf96a3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae57e067322093d0170563c9609890f7c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__wdt.html#gae57e067322093d0170563c9609890f7c">cyhal_wdt_is_enabled</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *obj)</td></tr>
<tr class="memdesc:gae57e067322093d0170563c9609890f7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if WDT is enabled.  <a href="group__group__hal__wdt.html#gae57e067322093d0170563c9609890f7c">More...</a><br /></td></tr>
<tr class="separator:gae57e067322093d0170563c9609890f7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga4f2a8a684b8a76b92b9417637bb55697" name="ga4f2a8a684b8a76b92b9417637bb55697"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4f2a8a684b8a76b92b9417637bb55697">&#9670;&nbsp;</a></span>cyhal_wdt_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_wdt_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize and start the WDT. </p>
<dl class="section note"><dt>Note</dt><dd>The specified timeout must be at least 1ms and at most the WDT's maximum timeout (see <a class="el" href="group__group__hal__wdt.html#gaf121c3f36d38b275c1887b8fddf96a3f" title="Gets the maximum WDT timeout in milliseconds.">cyhal_wdt_get_max_timeout_ms()</a>).</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to a WDT object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">timeout_ms</td><td>The time in milliseconds before the WDT times out (1ms - max) (see <a class="el" href="group__group__hal__wdt.html#gaf121c3f36d38b275c1887b8fddf96a3f" title="Gets the maximum WDT timeout in milliseconds.">cyhal_wdt_get_max_timeout_ms()</a>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request</dd></dl>
<p>Returns <a class="el" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> if the operation was successfull. </p>

</div>
</div>
<a id="ga976a8b0fe8fe66f89311cfca18768b13" name="ga976a8b0fe8fe66f89311cfca18768b13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga976a8b0fe8fe66f89311cfca18768b13">&#9670;&nbsp;</a></span>cyhal_wdt_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_wdt_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Free the WDT. </p>
<p >Powers down the WDT. Releases object (obj). After calling this function no other WDT functions should be called except <a class="el" href="group__group__hal__wdt.html#ga4f2a8a684b8a76b92b9417637bb55697" title="Initialize and start the WDT.">cyhal_wdt_init()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The WDT object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaeb43bee6a246da3eedfb5d06fbd226de" name="gaeb43bee6a246da3eedfb5d06fbd226de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeb43bee6a246da3eedfb5d06fbd226de">&#9670;&nbsp;</a></span>cyhal_wdt_kick()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_wdt_kick </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Resets the WDT. </p>
<p >This function must be called periodically to prevent the WDT from timing out and resetting the device.</p>
<p >See <a class="el" href="group__group__hal__wdt.html#subsection_wdt_snippet1">Snippet 1: Initialize the WDT and kick periodically</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The WDT object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaae8da9770e8e061c341bf9f604b91260" name="gaae8da9770e8e061c341bf9f604b91260"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaae8da9770e8e061c341bf9f604b91260">&#9670;&nbsp;</a></span>cyhal_wdt_start()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_wdt_start </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start (enable) the WDT. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The WDT object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gac4a8ed58907508cc2ebf9a29c2d86f39" name="gac4a8ed58907508cc2ebf9a29c2d86f39"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac4a8ed58907508cc2ebf9a29c2d86f39">&#9670;&nbsp;</a></span>cyhal_wdt_stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_wdt_stop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stop (disable) the WDT. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The WDT object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga84de4fa0ac7dbacb681e82a5df94f6d5" name="ga84de4fa0ac7dbacb681e82a5df94f6d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga84de4fa0ac7dbacb681e82a5df94f6d5">&#9670;&nbsp;</a></span>cyhal_wdt_get_timeout_ms()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_wdt_get_timeout_ms </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the WDT timeout. </p>
<p >Gets the configured time, in milliseconds, before the WDT times out.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The WDT object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The time in milliseconds before the WDT times out </dd></dl>

</div>
</div>
<a id="gaf121c3f36d38b275c1887b8fddf96a3f" name="gaf121c3f36d38b275c1887b8fddf96a3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf121c3f36d38b275c1887b8fddf96a3f">&#9670;&nbsp;</a></span>cyhal_wdt_get_max_timeout_ms()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_wdt_get_max_timeout_ms </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the maximum WDT timeout in milliseconds. </p>
<dl class="section return"><dt>Returns</dt><dd>The maximum timeout for the WDT </dd></dl>

</div>
</div>
<a id="gae57e067322093d0170563c9609890f7c" name="gae57e067322093d0170563c9609890f7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae57e067322093d0170563c9609890f7c">&#9670;&nbsp;</a></span>cyhal_wdt_is_enabled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_wdt_is_enabled </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__wdt__t">cyhal_wdt_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if WDT is enabled. </p>
<p >This will return true after <a class="el" href="group__group__hal__wdt.html#gaae8da9770e8e061c341bf9f604b91260">cyhal_wdt_start</a> is called. It will return false before the WDT is started, or after <a class="el" href="group__group__hal__wdt.html#gac4a8ed58907508cc2ebf9a29c2d86f39">cyhal_wdt_stop</a> is called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The WDT object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of WDT is_enabled request </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
